﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;

namespace FB.Infrastructure
{
    public class SmtpClientProxy : ISmtpClient
    {
        //protected SmtpClient _smtpClient;
        public SmtpClient SMTPClient { get; set; }

        public event SendCompletedEventHandler SendCompleted
        {
            add { SMTPClient.SendCompleted += value; }
            remove { SMTPClient.SendCompleted -= value; }
        }

        public SmtpClientProxy()
        {
            SMTPClient = new SmtpClient();
        }

        public SmtpClientProxy(SmtpClient smtpClient)
        {
            SMTPClient = smtpClient;
        }

        #region ISmtpClient Members

        public void Send(MailMessage mailMessage)
        {
            SMTPClient.Send(mailMessage);
        }

        public void SendAsync(MailMessage mailMessage, object userToken)
        {
            SMTPClient.SendAsync(mailMessage, userToken);
        }

        #endregion
    }
}